﻿using Microsoft.EntityFrameworkCore.Metadata.Internal;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace EFCore7;

[Table(name: "Biz_Post")]
public class Biz_Post
{
    [Key]
    [Description("PostId")]
    public int PostId { get; set; }

    [Column(TypeName = "varchar(255)"), Required]
    [Description("Title")]
    public string Title { get; set; }

    [Column(TypeName = "varchar(255)"), Required]
    [Description("Content")]
    public string Content { get; set; }

    [Description("Rating")]
    public int Rating { get; set; }

    [Description("BlogId")]
    public int BlogId { get; set; }

    [Description("CreateTime")]
    public DateTime CreateTime { get; set; } = DateTime.Now;

    public Biz_Blog Blog { get; set; }
}